HttpModulesSection Class [IIS 7 and higher]

Contains ASP.NET modules.

Syntax

class HttpModulesSection : ConfigurationSectionWithCollection

Methods

The following table lists the methods exposed by the HttpModulesSection class.

Name

Description

Add

(Inherited from ConfigurationSectionWithCollection.)

Clear

(Inherited from ConfigurationSectionWithCollection.)

Get

(Inherited from ConfigurationSectionWithCollection.)

GetAllowDefinition

(Inherited from ConfigurationSection.)

GetAllowLocation

(Inherited from ConfigurationSection.)

Remove

(Inherited from ConfigurationSectionWithCollection.)

RevertToParent

(Inherited from ConfigurationSection.)

SetAllowDefinition

(Inherited from ConfigurationSection.)

SetAllowLocation

(Inherited from ConfigurationSection.)

Properties

The following table lists the properties exposed by the HttpModulesSection class.

Name

Description

Location

(Inherited from ConfigurationSection.) A key property.

HttpModules

An array of HttpModuleAction values that contain ASP.NET modules.

Path

(Inherited from ConfigurationSection.) A key property.

SectionInformation

(Inherited from ConfigurationSection.)

Subclasses

This class contains no subclasses.

Remarks

The modules in the HttpModulesSection class are specific to ASP.NET and are in the <system.web> section of the Web.config file. Each of these modules is represented by an instance of the HttpModuleAction class.

The modules in the ModulesSection class are related to IIS 7 and are in the <system.webServer> section of the ApplicationHost.config file. Each of these modules is represented by an instance of the ModuleAction class.

Example

The following example displays HttpModulesSection properties, including the HttpModuleAction values that are in the HttpModules property.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")

' Get the HttpModulesSection.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "HttpModulesSection", oSection

' Display the Path and Location properties.
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo

' Display the HttpModuleAction instances that are contained
' in the HttpModules property.
WScript.Echo "----------( Http Modules )----------"
Counter = 0
For Each oHttpModule In oSection.HttpModules
     Counter = Counter + 1
     WScript.Echo "[" & Counter & "] Name: " & oHttpModule.Name
     WScript.Echo "Type: " & oHttpModule.Type
     WScript.Echo
Next

Inheritance Hierarchy

ConfigurationSection

   ConfigurationSectionWithCollection

      HttpModulesSection

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

ConfigurationSectionWithCollection Class [IIS 7 and higher]

HttpModuleAction Class [IIS 7 and higher]

ModuleAction Class [IIS 7 and higher]

ModulesSection Class [IIS 7 and higher]